package com.dragon.modules.yuegou.query.live;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.live.GetliveinfoEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 直播间回放视频 动态查询条件
 * 
 * @author ZSH
 * @date 2020-06-06 15:48:40
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class GetliveinfoQuery extends GetliveinfoEntity implements Query<GetliveinfoEntity> {

    /** Id查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 商圈Id查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

    /** 直播间Id查询条件 */
	@JsonUnwrapped(prefix = "broadcastId")
	private Condition<String> broadcastIdCondition;

    /** 回放视频查询条件 */
	@JsonUnwrapped(prefix = "mediaUrl")
	private Condition<String> mediaUrlCondition;

    /** 回放视频 url 过期时间查询条件 */
	@JsonUnwrapped(prefix = "expireTime")
	private Condition<LocalDateTime> expireTimeCondition;

    /** 回放视频创建时间查询条件 */
	@JsonUnwrapped(prefix = "createTime")
	private Condition<LocalDateTime> createTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public GetliveinfoQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public GetliveinfoQuery(GetliveinfoEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public GetliveinfoQuery(GetliveinfoQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if(other.broadcastIdCondition != null) {
			this.broadcastIdCondition = other.broadcastIdCondition.copy();
		}
		if(other.mediaUrlCondition != null) {
			this.mediaUrlCondition = other.mediaUrlCondition.copy();
		}
		if(other.expireTimeCondition != null) {
			this.expireTimeCondition = other.expireTimeCondition.copy();
		}
		if(other.createTimeCondition != null) {
			this.createTimeCondition = other.createTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<GetliveinfoEntity> toQueryWrapper() {
		QueryWrapper<GetliveinfoEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (broadcastIdCondition != null) {
			broadcastIdCondition.toWrapper(wrapper, COL_BROADCAST_ID);
		}
		if (mediaUrlCondition != null) {
			mediaUrlCondition.toWrapper(wrapper, COL_MEDIA_URL);
		}
		if (expireTimeCondition != null) {
			expireTimeCondition.toWrapper(wrapper, COL_EXPIRE_TIME);
		}
		if (createTimeCondition != null) {
			createTimeCondition.toWrapper(wrapper, COL_CREATE_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回Id查询条件
	 * 
	 * @return idCondition Id查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取Id查询条件
	 * 
	 * @return idCondition Id查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置Id查询条件
	 * 
	 * @param idCondition Id查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回商圈Id查询条件
	 * 
	 * @return busdIdCondition 商圈Id查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}
	
	/**
	 * 获取商圈Id查询条件
	 * 
	 * @return busdIdCondition 商圈Id查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置商圈Id查询条件
	 * 
	 * @param busdIdCondition 商圈Id查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回直播间Id查询条件
	 * 
	 * @return broadcastIdCondition 直播间Id查询条件
	 */
	public Condition<String> broadcastId() {
		this.broadcastIdCondition = new Condition<>();
		return this.broadcastIdCondition;
	}
	
	/**
	 * 获取直播间Id查询条件
	 * 
	 * @return broadcastIdCondition 直播间Id查询条件
	 */
	public Condition<String> getBroadcastIdCondition() {
		return broadcastIdCondition;
	}

	/**
	 * 设置直播间Id查询条件
	 * 
	 * @param broadcastIdCondition 直播间Id查询条件
	 */
	public void setBroadcastIdCondition(Condition<String> broadcastIdCondition) {
		this.broadcastIdCondition = broadcastIdCondition;
	}

	/**
	 * 构造并返回回放视频查询条件
	 * 
	 * @return mediaUrlCondition 回放视频查询条件
	 */
	public Condition<String> mediaUrl() {
		this.mediaUrlCondition = new Condition<>();
		return this.mediaUrlCondition;
	}
	
	/**
	 * 获取回放视频查询条件
	 * 
	 * @return mediaUrlCondition 回放视频查询条件
	 */
	public Condition<String> getMediaUrlCondition() {
		return mediaUrlCondition;
	}

	/**
	 * 设置回放视频查询条件
	 * 
	 * @param mediaUrlCondition 回放视频查询条件
	 */
	public void setMediaUrlCondition(Condition<String> mediaUrlCondition) {
		this.mediaUrlCondition = mediaUrlCondition;
	}

	/**
	 * 构造并返回回放视频 url 过期时间查询条件
	 * 
	 * @return expireTimeCondition 回放视频 url 过期时间查询条件
	 */
	public Condition<LocalDateTime> expireTime() {
		this.expireTimeCondition = new Condition<>();
		return this.expireTimeCondition;
	}
	
	/**
	 * 获取回放视频 url 过期时间查询条件
	 * 
	 * @return expireTimeCondition 回放视频 url 过期时间查询条件
	 */
	public Condition<LocalDateTime> getExpireTimeCondition() {
		return expireTimeCondition;
	}

	/**
	 * 设置回放视频 url 过期时间查询条件
	 * 
	 * @param expireTimeCondition 回放视频 url 过期时间查询条件
	 */
	public void setExpireTimeCondition(Condition<LocalDateTime> expireTimeCondition) {
		this.expireTimeCondition = expireTimeCondition;
	}

	/**
	 * 构造并返回回放视频创建时间查询条件
	 * 
	 * @return createTimeCondition 回放视频创建时间查询条件
	 */
	public Condition<LocalDateTime> createTime() {
		this.createTimeCondition = new Condition<>();
		return this.createTimeCondition;
	}
	
	/**
	 * 获取回放视频创建时间查询条件
	 * 
	 * @return createTimeCondition 回放视频创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreateTimeCondition() {
		return createTimeCondition;
	}

	/**
	 * 设置回放视频创建时间查询条件
	 * 
	 * @param createTimeCondition 回放视频创建时间查询条件
	 */
	public void setCreateTimeCondition(Condition<LocalDateTime> createTimeCondition) {
		this.createTimeCondition = createTimeCondition;
	}

}
